home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld Secrets (4th Edition)
/
Mac Secrets CD 4th Ed.toast
/
Apple Advanced Technologies
/
Apple Speech Technologies 1.5
/
PlainTalk Developer Info
/
Speech Recognition Manager SDK
/
SR Sample Code
/
Speakable Items Example
/
Sources
/
Process & Finder Stuff
/
ProcessUtils.h
< prev
Wrap
Text File
|
1991-11-25
|
3KB
|
86 lines
/*****************************************************************************
*
* ProcessUtils.h
*
* DESCRIPTION
* Interface to ProcessUtils.c.
*
* AUTHOR: Matt Pallakoff
*
* CREATED: 9-9-91
*
*****************************************************************************/
#include "PPCToolBox.h"
#include "AppleEvents.h"
#define PROCESS_NOT_FOUND_ERR -2
/* PUFindLocalProcess gets the location and port info corresponding to the
* process or application with the given signature. If the process is already
* running, the info is just returned. Otherwise, if launchIfCan is true then
* this routine tries to find the application with the given signature on
* a locally mounted volume, and if it finds it then it launches it and returns
* the information. If the process can't be found then this routine returns
* PROCESS_NOT_FOUND_ERR (i.e. -2). If all goes well, 0 is returned. Otherwise
* a non-zero error code is returned.
*/
OSErr PUFindLocalProcess (OSType processSignature,
Boolean launchIfCan,
LocationNameRec *theLocation,
PortInfoRec *thePortInfo);
/* PUSendAppleEventWith1Param sends an apple event with the given class and ID to the given location.
* The direct parameter is set to the given data before sending. This routine doesn't wait for
* or return a reply (see PUSendAppleEventWith1ParamAndWait below).
*/
OSErr PUSendAppleEventWith1Param(LocationNameRec *theLocation,
PortInfoRec *thePortInfo,
AEEventClass eventClass,
AEEventID eventID,
DescType dataType,
void *dataPtr,
Size dataSize);
/* PUSendAppleEventWith2Params sends an appleevent with two parameters. If sessionID is non-zero
* then the sessionID is used to indicate the receiving process. Otherwise if signature is non-zero
* then the signature is used to indicate the receiving process. Otherwise theLocation and
* thePortInfo are used. Also, if 'waitForReply' is true then this routine waits 'timeout' ticks
* for the reply, and sets theReply to the reply AppleEvent if all goes well. The calling routine
* should dispose the reply AppleEvent (using AEDisposeDesc(theReply)) when done with it.
*/
OSErr PUSendAppleEventWith2Params(long sessionID,
OSType signature,
LocationNameRec *theLocation,
PortInfoRec *thePortInfo,
AEEventClass eventClass,
AEEventID eventID,
AEKeyword keyWord1,
DescType dataType1,
void *dataPtr1,
Size dataSize1,
AEKeyword keyWord2,
DescType dataType2,
void *dataPtr2,
Size dataSize2,
Boolean waitForReply,
long timeOut,
AppleEvent *theReply);
/* PUSendAppleEventWith1Param is the same as PUSendAppleEventWith1Param, except it waits for the
* reply to the AppleEvent. It waits timeout ticks before assuming the send failed. If the
* send succeeded, it sets theReply to point to the reply AppleEvent (which the calling routine
* should dispose when done with it).
*/
OSErr PUSendAppleEventWith1ParamAndWait(LocationNameRec *theLocation,
PortInfoRec *thePortInfo,
AEEventClass eventClass,
AEEventID eventID,
DescType dataType,
void *dataPtr,
Size dataSize,
long timeout,
AppleEvent *theReply);